<include file="__THEME__/header" />

<link href="../Public/basic.css" rel="stylesheet" type="text/css" />

<link href="../Public/friend.css" rel="stylesheet" type="text/css" />


<div class="content"><!-- 内容 begin  -->
    <div class="main"> <!-- 右侧内容 begin  -->
        <div class=page_title> <!-- page_title begin -->
            <h2><img src="../Public/images/ico_Friend.gif" />好友</h2>
            <div class="c"></div>
        </div><!-- page_title end -->
        <div class="tab-menu"><!-- 切换标签 begin  -->
            <ul>
                <php>if($uid == $mid || !$uid){</php>
                <li><a href="__URL__/index" class="on"><span>我的好友</span></a></li>
                <li><a href="__URL__/ping"><span>好友屏蔽</span></a></li>
                <li><a href="__URL__/track"><span>访问脚印</span></a></li>
                <li><a href="__URL__/find"><span>查找朋友</span></a></li>
                <php>}else{</php>
                <li><a href="__URL__/index/uid/{.uid}" class="on"><span>{$uid|getUserName}的好友</span></a></li>
                <php>}</php>
                <li><a href="__APP__/Invite"><span><div class="ico_add">&nbsp;</div>邀请好友</span></a></li>
            </ul>
        </div><!-- 切换标签 end  -->
        <div class="friendBox">

            <php>if( !$uid || $uid == $mid ){</php>
            <div class="sidebar pt10">{:W("FriendGroup",array('type'=>'friend'))}</div>
            <php>}</php>


            <script>
                function removeFri(fuid){

                    var fname = $("#fname_"+fuid).text();

                    Confirm({message:'确定解除和'+fname+'的好友关系吗？',handler:function(tp){
                            if(tp=='ok'){
                                $.post(APP+"/Friend/removeFriend",{fuid:fuid},function(txt){
                                    if(txt){
                                        $("#fri_"+fuid).remove();
                                    }else{
                                        Alert("忽略失败!");
                                    }
                                });
                            }
                            if(tp=='cancel'){
                                ymPrompt.close();
                            }
                            if(tp=='close'){
                                ymPrompt.close();
                            }
                        }});
                }

                function set_group(fuid){
                    Win({message:APP+'/Friend/setGroup/fuid/'+fuid,width:392,height:220,title:'好友分组',handler:function(){ymPrompt.close();},autoClose:false,iframe:true,allowRightMenu:true});
                }
            </script>
            <div class="FList"><!-- 我的好友 begin  -->
                <ul style="padding: 0px;margin: 10px auto 0px auto;">
                    <volist name="friends" id="user">

                        <li class="btmlineD li pb10 pt5" id="fri_{$user.fuid}" >
                            <div class="left" style="width:70px;"><span class="headpic50">
                                    <a href="__APP__/space/{$user.fuid}"  class="tips" rel="__TS__/Index/userInfo/uid/{$user['fuid']}"><img src="{$user.fuid|getUserFace='middle'}" /></a></span></a></div>
                            <div class="left" style="width:450px; margin-right:50px;">
                                <p class="lh20"><a href="__APP__/space/{$user.fuid}" id="fname_{$user.fuid}">{$user.fuid|isOnlineIcon}{$user.fusername}</a></p>

                                <php>if( !$uid || $uid == $mid ){</php>
                                <p class="cGray2 lh20">分组：<a href="javascript:set_group({$user.fuid})">{:getFriGroup($mid,$user["fuid"])}</a></p>
                                <php>}</php>
                                <p class="cGray2 lh20"><span class="wn">心情：</span>{$user.fuid|getUserMini}</p>
                            </div>
                            <div class="left" style="width:60px;">
                                <?php if(!$is_me){ ?>
                                <p class="lh20"><a href="__APP__/space/{$user.fuid}">查看空间</a></p>
                                <p class="lh20"><a href="__APP__/Notify/write/uid/{$user.fuid}">发送短信</a></p>
                                <?php }else{ ?>
                                <p class="lh20"><a href="__APP__/space/{$user.fuid}">查看空间</a></p>
                                <p class="lh20"><a href="__APP__/Notify/write/uid/{$user.fuid}">发送短信</a></p>
                                <p class="lh20"><a href="javascript:removeFri({$user.fuid})">解除关系</a></p>
                                <?php } ?>


                            </div>
                            <div class="c"></div>
                        </li>

                    </volist>


                </ul>

                <php>echo page($total_page);</php>

            </div><!-- 我的好友 end  -->
        </div>







    </div><!-- 右侧内容 end  -->


    <div class="c"></div>
</div><!-- 内容 end -->
<include file="__THEME__/footer" />
